﻿using Web7.Ioc;

namespace Web7.Core.Security
{
    public interface IAuthenticationService : IDependency
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="user"></param>
        /// <param name="createPersistentCookie"></param>
        void SignIn(IUser user, bool createPersistentCookie);

        /// <summary>
        /// 用户登录入口
        /// </summary>
        /// <returns></returns>
        string GetSigInUrl();

        /// <summary>
        /// 用户登出
        /// </summary>
        void SignOut();

        /// <summary>
        /// 为请求添加用户验证
        /// </summary>
        /// <param name="user"></param>
        void SetAuthenticatedUserForRequest(IUser user);

        /// <summary>
        /// 注册
        /// </summary>
        void Registration();

        /// <summary>
        /// 获取已验证用户
        /// </summary>
        /// <returns></returns>
        IUser GetAuthenticatedUser();
    }
}
